<template>
	<div class="mine">
		<div class="box">
			<div class="hearderBox">
				<div class="hearderBoxIcon" @click="goBack">
					<img src="../../assets/images/fanhuijiantou.png" alt="">
				</div>
				银行卡管理
			</div>
			<div class="proList">
				<div v-if="info.bank_name == '' || info.bank_name == null" class="addBankBox"
					@click="goNextPage('/bindbank')">
					<div class="addBankBoxIt">
						新增银行卡 +
					</div>
				</div>
				<div class="proListIt" v-else>
					<div class="proListItTop">
						银行卡号
					</div>
					<div class="proListItBottOW">
						<div class="BriBox">
							<div class="proListItBot">
								{{info.bank_card}}
							</div>
							<div class="BriBoxright">
								<img src="../../assets/images/xiugai.png" alt="">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- <div class="buttons">
			<img src="../../assets/images/xiaoxi.png" alt="" />
		</div> -->
		<loadingFour :msgText="msgTextTow" v-if="isShowLoadingTeow" @closeGuanbiTow="closeGuanbi"></loadingFour>
	</div>
</template>

<script>
	import {
		userinfo
	} from "../../utils/api.js"
	import loadingFour from '../../components/loadingFour.vue';
	export default {
		data() {
			return {
				close: true,
				info: [],
				msgTextTow: "",
				isShowLoadingTeow: false
			}
		},
		components: {
			loadingFour
		},
		created() {},
		mounted() {
			this.info = JSON.parse(localStorage.getItem('userInfo'))
			// this.getuserinfo()
		},

		methods: {
			closeGuanbi(e) {
				this.isShowLoadingTeow = false;
			},
			getuserinfo() {
				userinfo().then((res) => {
					if (res.status.errorCode == 0) {
						this.info = res.data
					} else if (res.status.errorCode == 401) {
						this.$emit('getTokenNum', false)
						console.log('401')
					} else {
						// this.$message.error(res.status.msg);
						this.msgTextTow = res.status.msg;
						this.isShowLoadingTeow = true;
							setTimeout(()=>{
								this.isShowLoadingTeow = false;
							},2000)
						// this.$message({
						// 	showClose: true,
						// 	message: res.status.msg,
						// 	type: 'error'
						// });
					}
				}).catch((err) => {
					console.log(err, 'err')
				});
			},
			goBack() {
				this.$router.go(-1)
			},
			goNextPage(page) {
				this.$router.push(page)
			}
		}
	}
</script>

<style scoped>
	* {
		box-sizing: border-box;
	}

	.mine {
		position: relative;
		/* padding-bottom: calc(50px + env(safe-area-inset-bottom)); */
	}

	.box {
		background-color: #ffffff;
		display: flex;
		flex-direction: column;
		min-height: 100vh;
	}

	.buttons {
		position: fixed;
		bottom: 10%;
		right: 10px;
		background-color: #99D2E3;
		width: 60px;
		height: 60px;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.buttons img {
		width: 32px;
		height: 32px;
	}


	.hearderBox {
		width: 100%;
		height: 45px;
		background-color: #fff;
		position: fixed;
		top: 0;
		font-weight: 300;
		line-height: 45px;
		text-align: center;
		font-size: 20px;
		color: #545658;
		box-shadow: inset 0 -1px 0 #ececec;
		left: 0;
		overflow: hidden;
		z-index: 99;
	}

	.hearderBoxIcon {
		width: 50px;
		position: fixed;
		top: 3px;
		left: 0px;
	}

	.hearderBoxIcon img {
		width: 20px;
		height: 20px;
	}

	.proList {
		width: 100%;
		padding: 0px 20px 0;
		margin-top: 50px;
		box-sizing: border-box;
	}

	.proListIt {
		width: 100%;
		padding: 15px 0;
		box-sizing: border-box;
		border-bottom: 1px solid #e9e9e9;
	}

	.proListItTop {
		color: #545658;
		font-size: 10px;
		margin-bottom: 5px;
		opacity: .6;
	}

	.proListItBot {
		font-size: 14px;
		line-height: 1.29;
		min-height: 18px;
		color: #545658;
		font-weight: 300;
	}

	.proListItBottOW {
		width: 100%;
	}

	.BriBox {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.BriBoxright img {
		width: 20px;
		height: 23px;
	}

	.addBankBox {
		width: 100%;
		margin: 20px auto 0;
		align-items: center;
		background: #fafafc;
		border: 1px solid #ececec;
		border-radius: 5px;
		display: flex;
		justify-content: center;
		min-height: 100px;
		padding: 22px 0;
	}

	.addBankBoxIt {
		background-color: #7240ff;
		border: none;
		color: #fff;
		cursor: pointer;
		font-size: 15px;
		font-stretch: normal;
		font-style: normal;
		font-weight: 300;
		height: 44px;
		line-height: 44px;
		border-radius: 5px;
		padding: 0 20px;
		width: auto;
	}
</style>